<meta charset='utf-8'>
<%@ page language="java" errorPage="/error.jsp" contentType="text/html; charset=utf-8"%>
<%@ page session="false" %>
<%@ include file="taglib.jsp" %>
<html>
<head>
    <title>Add new subject</title>
    <link href='<c:url value = "/css/main.css"/>' rel="stylesheet" type="text/css"/>
</head>
<body>
    <div class="toper">
        <div class="img">
            <a href="/productshop" align="center">
                <img src='<c:url value = "/image/base/back_black.png"/>' alt="на главную" title="на главную"/>
            </a>
        </div>

        <div class="upper_white_form">
            <form method="post">
                <table>
                    <tr>
                        <td valign="top">
                            name of new ${elementType}:
                        </td>
                    </tr>
                    <tr>
                        <td valign="top">
                            <input type="text" name="${newElementName}" size="20"/>
                        </td>
                        <td valign="top">
                            <input type="submit" value="SAVE">
                        </td>
                    </tr>
                    </td></tr>
                </table>
            </form>
        </div>
    </div>

    <div class = "main_content">
        <table name = "List of ${elementType}s" width="20%" cellpadding="0" cellspacing="1" border="0">
            <tr bgcolor="cccccc">
                <th valign="top"><strong>${elementType} name</strong></th>
            </tr>
            <c:choose>
                <c:when test="${empty items}">
                    no ${elementType}s for now
                </c:when>
                <c:otherwise>
                    <c:forEach var="item" items="${items}">
                        <tr>
                            <td align = "center">
                                <c:out value="${item.name}"/>
                                <c:catch>
                                        <c:if test="${empty item.gpas && empty item.lecturers}">
                                            <a href="/productshop/remove${elementType}/${item.id}">
                                                <img src='<c:url value = "/image/base/remove.png"/>' width="15"
                                                     alt="remove" title="remove"/>
                                            </a>
                                        </c:if>
                                </c:catch>
                                <c:catch>
                                        <c:if test="${empty item.students && empty item.lecturers}">
                                            <a href="/productshop/remove${elementType}/${item.id}">
                                                <img src='<c:url value = "/image/base/remove.png"/>' width="15"
                                                     alt="remove" title="remove"/>
                                            </a>
                                        </c:if>
                                </c:catch>
                                <%--<a href="/productshop/edit${elementType}/${item.name}">
                                    <img src='<c:url value = "/image/base/edit.png"/>' width="15"
                                         alt="edit" title="edit"/>
                                </a>--%>
                            </td>
                        </tr>
                    </c:forEach>
                </c:otherwise>
            </c:choose>

        </table>
    </div>
</body>
</html>